program PiMC;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  N0, N, i: Integer;
  x, y, m, l: Double;
  fout: TextFile;

begin
  Randomize;
  AssignFile (fout, 'output.txt');
  Rewrite (fout);
  N:=0;
  N0:=0;
  for i:=0 to 100000000 do
  begin
    N:=N+1;
    x:=2*random;
    y:=2*random;
    m:=(x-1)*(x-1)+(y-1)*(y-1);
    if (m<=1) then
      N0:=N0+1;
    l:=4*N0/N;
    if (N mod 1000=0) then
      Writeln (fout, Pi-l);
  end;
  CloseFile (fout);
end.
 